package org.springblade.modules.ehb.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.modules.ehb.mapper.EhbPolicyMapper;
import org.springblade.modules.ehb.service.IEhbPolicyService;
import org.springblade.modules.ehb.vo.EhbPolicyVO;
import org.springblade.modules.ehb.vo.EhbRelatedPolicyVO;
import org.springblade.modules.policy.entity.Policy;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EhbPolicyServiceImpl extends BaseServiceImpl<EhbPolicyMapper, Policy> implements IEhbPolicyService {

	@Override
	public IPage<EhbPolicyVO> selectPage(IPage<EhbPolicyVO> page, Integer policyType, Long levelId, Character industryType, String policyName) {
		return page.setRecords(baseMapper.selectPolicyPage(policyType, levelId, industryType, policyName, page));
	}

	@Override
	public IPage<EhbPolicyVO> selectPushPage(IPage<EhbPolicyVO> page, Boolean isPrecisePush, String enterpriseSpecial) {
		return page.setRecords(baseMapper.selectPushPolicyPage(isPrecisePush, enterpriseSpecial, page));
	}

	@Override
	public EhbPolicyVO getById(Long id) {
		return baseMapper.getById(id);
	}

	@Override
	public Integer countPolicy() {
		return baseMapper.countPolicy();
	}

	@Override
	public List<EhbRelatedPolicyVO> selectRelatedPolicy(String policyIds) {
		return baseMapper.selectRelatedPolicy(policyIds);
	}
}
